@extends('public.dashboard_base')
@section('title', '邮箱认证')

@section('content')
    @php
        $user =auth('admin')->user();
    @endphp

    {{--    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css">--}}

    <div class="control_panel_content">
        <div class="navBreadcrumb">
            <ul>
                <li>账户管理</li>
                <li>我的认证</li>
                <li>邮箱认证</li>
            </ul>
        </div>
        <div class="panel">
            <div class="sub_nav_container">
                <ul class="clearfix">
                    <li class="active"><a href="javascript:;">邮箱认证</a></li>
                    <li><a href="/account/auth/email/add">添加邮箱认证</a></li>
                </ul>
            </div>
            <div class="search_cond_wrap">
                <div>
                    <form id="queryForm">
                        <span>邮箱：</span>
                        <input type="text" id="search_text" name="queryValue" placeholder="请输入搜索">&ensp;
                        <input type="submit" class="btn btn_primary" id="queryBtn" value="搜索">
                        <input type="reset" class="btn btn_default" id="resetBtn" value="重置">
                    </form>
                </div>
            </div>
            <section class="mainResult">
                共: <span class="text_orange"><span id="total-rows">{{count($data)}}</span></span> 条
            </section>
            <table class="table_style">
                <thead>
                <tr>
                    <th width="30%">邮箱</th>
                    <th width="20%">提交时间</th>
                    <th width="20%">状态</th>
{{--                    <th width="20%">操作</th>--}}
                </tr>
                </thead>
                <tbody class="auth_email_list">
                @forelse($data as $item)
                    <tr>
                        <td>{{$item->email}}</td>
                        <td>{{$item->updated_at}}</td>
                        <td>
                            @if($item->status ==0)
                                <span class="text_red">等待认证</span>
                            @else
                                <span class="text_green">认证通过</span>
                            @endif
                        </td>
{{--                        <td>--}}
{{--                            —--}}
{{--                        </td>--}}
                    </tr>
                @empty
                    <tr>
                        <td colspan="4" style="color: #999; text-align: center;">没有数据</td>
                    </tr>
                @endforelse
                </tbody>
            </table>
        </div>
        <div style="margin: 20px 20px;display: flex; justify-content: center">
            <div>
                {{ $data->appends(['queryValue' => $queryValue])->links() }}
            </div>
        </div>

    </div>
@endsection
@section('script')
    <script>
        $(function () {
            var link = $("#account-certification");
            link.parent().parent().parent().addClass("active");
            link.parent().addClass("active");
        });

        $(function () {
            $("#search_text").val('{{$queryValue}}');
        })
    </script>
@endsection
